.class Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;
.super Ljava/lang/ref/WeakReference;
.source "ServerConfigurationService.java"

# interfaces
.implements Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/burstly/lib/service/ServerConfigurationService;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "ConfigurationTaskWrapper"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/ref/WeakReference",
        "<",
        "Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;",
        ">;",
        "Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;",
        "Ljava/lang/Runnable;"
    }
.end annotation


# instance fields
.field private mRunningTask:Ljava/util/concurrent/Future;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/Future",
            "<*>;"
        }
    .end annotation
.end field


# direct methods
.method constructor <init>(Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;)V
    .locals 0
    .parameter "recipient"

    .prologue
    .line 137
    invoke-direct {p0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    .line 138
    return-void
.end method


# virtual methods
.method public configure(Ljava/util/Map;)V
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 142
    .local p1, configurationData:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;

    .line 143
    .local v0, recep:Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;
    if-eqz v0, :cond_0

    .line 144
    invoke-interface {v0, p1}, Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;->configure(Ljava/util/Map;)V

    .line 146
    :cond_0
    return-void
.end method

.method public equals(Ljava/lang/Object;)Z
    .locals 3
    .parameter "o"

    .prologue
    .line 220
    invoke-virtual {p0}, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;

    .local v1, thisRecipient:Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;
    move-object v2, p1

    .line 222
    check-cast v2, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;

    invoke-virtual {v2}, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->getRecepient()Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;

    move-result-object v0

    .line 223
    .local v0, thatRecipient:Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;
    if-eqz v1, :cond_0

    if-eqz v0, :cond_0

    .line 224
    invoke-virtual {v1, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v2

    .line 226
    :goto_0
    return v2

    :cond_0
    invoke-super {p0, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v2

    goto :goto_0
.end method

.method getRecepient()Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;
    .locals 1

    .prologue
    .line 176
    invoke-virtual {p0}, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;

    return-object v0
.end method

.method getRunningTask()Ljava/util/concurrent/Future;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/concurrent/Future",
            "<*>;"
        }
    .end annotation

    .prologue
    .line 191
    iget-object v0, p0, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->mRunningTask:Ljava/util/concurrent/Future;

    return-object v0
.end method

.method public hashCode()I
    .locals 2

    .prologue
    .line 214
    invoke-virtual {p0}, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;

    .line 215
    .local v0, recipient:Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Ljava/lang/Object;->hashCode()I

    move-result v1

    :goto_0
    return v1

    :cond_0
    invoke-super {p0}, Ljava/lang/Object;->hashCode()I

    move-result v1

    goto :goto_0
.end method

.method public isConstantRecepient()Z
    .locals 2

    .prologue
    .line 150
    invoke-virtual {p0}, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;

    .line 151
    .local v0, recep:Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;
    if-eqz v0, :cond_0

    .line 152
    invoke-interface {v0}, Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;->isConstantRecepient()Z

    move-result v1

    .line 154
    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method isScheduledInExecutor()Z
    .locals 1

    .prologue
    .line 200
    iget-object v0, p0, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->mRunningTask:Ljava/util/concurrent/Future;

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public run()V
    .locals 7

    .prologue
    const/4 v2, 0x0

    .line 159
    invoke-virtual {p0}, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;

    .line 160
    .local v1, recep:Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;
    if-eqz v1, :cond_0

    .line 161
    iget-object v3, p0, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->mRunningTask:Ljava/util/concurrent/Future;

    if-eqz v3, :cond_1

    iget-object v3, p0, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->mRunningTask:Ljava/util/concurrent/Future;

    invoke-interface {v3}, Ljava/util/concurrent/Future;->isCancelled()Z

    move-result v0

    .line 162
    .local v0, interrupted:Z
    :goto_0
    if-nez v0, :cond_2

    .line 163
    #calls: Lcom/burstly/lib/service/ServerConfigurationService;->safeApplyConfiguration(Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;)V
    invoke-static {v1}, Lcom/burstly/lib/service/ServerConfigurationService;->access$000(Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;)V

    .line 168
    .end local v0           #interrupted:Z
    :cond_0
    :goto_1
    return-void

    :cond_1
    move v0, v2

    .line 161
    goto :goto_0

    .line 165
    .restart local v0       #interrupted:Z
    :cond_2
    sget-object v3, Lcom/burstly/lib/service/ServerConfigurationService;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v4, Lcom/burstly/lib/service/ServerConfigurationService;->TAG:Ljava/lang/String;

    const-string v5, "Skipping config task for {0} due it was cancelled"

    const/4 v6, 0x1

    new-array v6, v6, [Ljava/lang/Object;

    aput-object v1, v6, v2

    invoke-virtual {v3, v4, v5, v6}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_1
.end method

.method setRunningTask(Ljava/util/concurrent/Future;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/concurrent/Future",
            "<*>;)V"
        }
    .end annotation

    .prologue
    .line 209
    .local p1, runningTask:Ljava/util/concurrent/Future;,"Ljava/util/concurrent/Future<*>;"
    iput-object p1, p0, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->mRunningTask:Ljava/util/concurrent/Future;

    .line 210
    return-void
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    .prologue
    .line 181
    invoke-virtual {p0}, Lcom/burstly/lib/service/ServerConfigurationService$ConfigurationTaskWrapper;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;

    .line 182
    .local v0, recipient:Lcom/burstly/lib/service/ServerConfigurationService$IServerConfigurable;
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    :goto_0
    return-object v1

    :cond_0
    const-string v1, "no recipient"

    goto :goto_0
.end method
